import request from '@/utils/request.js'

/**
 * 外协相关
 */

// 获取外协项目信息(类别)
export const getOutsourcingInfo = (params) => request({ url: `/web/outsourcingProject/getOutsourcingInfo`, method: 'get', params, loading: true })

// 关联船舶
export const relationBoatApi = (data) => request({ url: `/web/assistOrder/relationBoat`, method: 'post', data, loading: true })

// 修改外协单
export const editApi = (data) => request({ url: `/web/assistOrder/updateAssistOrder`, method: 'post', data, loading: true })

// 外协单详情
export const detailApi = (id) => request({ url: `/web/assistOrder/${id}`, method: 'get' })

// 删除外协单
export const deleteApi = (id) => request({ url: `/web/assistOrder/${id}`, method: 'DELETE', loading: true })

// 修改-增加外协明细
export const editOrderDetailApi = (data) => request({ url: `/web/assistOrder/operationAssistOrderDetail`, method: 'post', data })

// 删除外协单明细
export const deleteDetailApi = (params) => request({ url: `/web/assistOrder/deleteDetailPhysical`, method: 'get', params, loading: true })

// 批量修改采购项目明细分类
export const batchUpdateTypeApi = (params) => request({ url: `/web/assistOrder/batchUpdateType`, method: 'get', params, loading: true })

// 外协单列表
export const assistOrderListApi = (params, data) => request({ url: `/web/assistOrder/selectShcwAssistOrderList`, method: 'post', params, data, loading: true })

// 询价
export const invitationToQuoteApi = (data) => request({ url: `/web/assistOrder/invitationToQuote`, method: 'post', data, loading: true })

// 邀请报价外协单
export const queryInvitedOrderApi = (params, data) => request({ url: `/web/assistOrder/queryInvitedOrder`, method: 'post', params, data, loading: true })

// 分配报价员
export const headOfDistributionApi = (params) => request({ url: `/web/assistOrder/headOfDistribution`, method: 'get', params, loading: true })

// 参与报价
export const onlineQuoteApi = (params) => request({ url: `/web/assistQuotation/onlineQuote`, method: 'get', params, loading: true })

// 查询报价单详情
export const queryQuotationByIdApi = (params) => request({ url: `/web/assistQuotation/queryQuotationById`, method: 'get', params, loading: true })

// 查询报价单详情(船东)
export const viewOuotationApi = (params) => request({ url: `/web/assistQuotation/viewOuotation`, method: 'get', params, loading: true })

// 保存报价单
export const saveQuotationApi = (data) => request({ url: `/web/assistQuotation/saveQuotation`, method: 'post', data, loading: true })

// 提交报价单（详情
export const submitQuotationApi = (data) => request({ url: `/web/assistQuotation/submitQuotation`, method: 'post', data, loading: true })

// 提交报价单（列表
export const submitInListApi = (params) => request({ url: `/web/assistQuotation/submitInList`, method: 'get', params, loading: true })

// 修改报价单明细
export const updateQuotoDetailApi = (data) => request({ url: `/web/assistQuotation/updateQuotoDetail`, method: 'post', data, loading: true })

// 查看报价前置校验
export const viewBeforeApi = (data) => request({ url: `/web/assistQuotation/viewBefore`, method: 'post', data, loading: true })

// 查询收到的报价列表
export const assistQuotationQueryReceiveQuotaApi = (params, data) => request({ url: `/web/assistQuotation/queryReceiveQuota`, method: 'post', params, data, loading: true })

// 参与投标
export const joinBidApi = (params) => request({ url: `/web/assistQuotation/joinBid`, method: 'get', params, loading: true })

// 拒绝投标（放弃投标）
export const rejectionBidApi = (data) => request({ url: `/web/assistQuotation/rejectionBid`, method: 'post', data, loading: true })

// 确认中标操作
export const confirmQuotationApi = (data) => request({ url: `/web/assistQuotation/confirmQuotation`, method: 'post', data, loading: true })

// 发布的报价单
export const selectShcwQuotationAssistOrderListApi = (params, data) => request({ url: `/web/assistQuotation/selectShcwQuotationAssistOrderList`, method: 'post', params, data, loading: true })

// 接受中标
export const acceptanceQuotationApi = (params) => request({ url: `/web/assistQuotation/acceptanceQuotation`, method: 'get', params, loading: true })

// 拒绝中标
export const refusalQuotationApi = (data) => request({ url: `/web/assistQuotation/refusalQuotation`, method: 'post', data, loading: true })

// 可评价列表
export const queryAwaitingEvaluationApi = (params, data) => request({ url: `/web/assistQuotation/queryAwaitingEvaluation`, method: 'post', params, data, loading: true })

// 在线比价-外协报价
export const assistQuoteCompareApi = (data) => request({ url: `/web/comparePrice/assistQuoteCompare`, method: 'post', data })

// 导出报价
export const exportProcureQuoteApi = (params) => request({ url: `/web/assistQuotation/exportProcureQuote`, method: 'post', params, responseType: 'blob', loading: true })

// 外协报价单中船舶列表
export const getQuotaOrderShipApi = (data) => request({ url: `/web/assistQuotation/getQuotaOrderShip`, method: 'post', data: data || {} })

// 外协邀请报价中船舶列表
export const queryInvitedShipApi = (data) => request({ url: `/web/assistOrder/queryInvitedShip`, method: 'post', data: data || {} })

// 发布后编辑
export const inviteEditingApi = (params) => request({ url: `/web/assistQuotation/inviteEditing`, method: 'post', params })

// 邀请报价记录
export const queryQuoteRecordApi = (params) => request({ url: `/web/assistOrder/queryQuoteRecord`, method: 'get', params })
